
package controller;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.opensymphony.xwork2.ModelDriven;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import java.util.Map;
import model.//nameClass//Model;
import model.dao.//nameClass//DAO;
import model.entities.//nameClass//;

public class //nameClass_plural//Controller extends AppController implements ModelDriven<//nameClass//> {

    //nameClass// //nameclass// = new //nameClass//();
    ArrayList<//nameClass//> //nameclass_plural// = new ArrayList();    
    //nameClass//DAO //nameclass//Dao = new //nameClass//Model();
     private InputStream inputStream;
    Map parameters;

    public InputStream getInputStream() {
        return inputStream;
    }

    @Override
    public //nameClass// getModel() {
        return //nameclass//;
    }
    //views

    public String index() {
        total = //nameclass//Dao.count();
        //nameclass_plural// = //nameclass//Dao.getList(page_size, page_number);
        return "index";
    }

    public String read() {
        //nameclass// = //nameclass//Dao.read(//nameclass//.getId());
        return "read";
    }

    public String add() {        
        return "add";
    }

    public String edit() {        
        //nameclass// = //nameclass//Dao.read(//nameclass//.getId());
        return "edit";
    }

    public String create() {
        if (//nameclass//Dao.create(//nameclass//)) {
            total = //nameclass//Dao.count();
            //nameclass_plural// = //nameclass//Dao.getList(page_size, page_number);
            return "index";
        } else {            
            return "add";
        }
    }

    public String update() {
        if (//nameclass//Dao.update(//nameclass//)) {
            total = //nameclass//Dao.count();
            //nameclass_plural// = //nameclass//Dao.getList(page_size, page_number);
            return "index";
        } else {            
            return "edit";
        }
    }

    public String delete() {
        //nameclass//Dao.delete(//nameclass//.getId());
        total = //nameclass//Dao.count();
        //nameclass_plural// = //nameclass//Dao.getList(page_size, page_number);
        return "index";

    }

    public //nameClass// get//nameClass//() {
        return //nameclass//;
    }
        
    public void set//nameClass//(//nameClass// //nameclass//) {
        this.//nameclass// = //nameclass//;
    }

    public ArrayList<//nameClass//> get//nameClass_plural//() {
        return //nameclass_plural//;
    }

    public void set//nameClass_plural//(ArrayList<//nameClass//> //nameclass_plural//) {
        this.//nameclass_plural// = //nameclass_plural//;
    }
    
    //views_str//
}
